var dialogWindow = null;
var theField = null;

function ShowCalendar( formName, theInput, onlyDate ) {
    theField = eval( "document." + formName + "." + theInput );
    var calendarUrl = "./inc/calendar.php";
    if(onlyDate) {
    	calendarUrl = "./inc/calendar.php?onlyDate";
    }
    dialogWindow=window.open(calendarUrl, "Kalendář",
            "dependent=yes, menubar=no, location=no, resizable=no, width=350, height=240, toolbar=no, screenX=100, screeny=100" );
}

function Transfer( theValue ) {
         if( theField != null ) theField.value = theValue;
}

function HideDialog() {
    if( dialogWindow != null ) {
    if (typeof(dialogWindow.document) == "object")
        dialogWindow.close()
    }
}